package org.mfw.obj.list
{
	import mx.collections.ArrayCollection;
	
	import org.mfw.interfaces.obj.list.IAlbumList;
	import org.mfw.interfaces.obj.list.ICoverList;
	import org.mfw.interfaces.obj.mob.*;
	import org.mfw.obj.mob.Album;

	public class AlbumList extends MediaListObject implements IAlbumList
	{
		public function AlbumList(object:Object=null)
		{
			super();
			if (object) {
				this.getAlbumlistFromObject(object);
			}
		}
		
		protected function getAlbumlistFromObject(object:Object):void{
			this._elementArray= new Array();
			if(!object.hasOwnProperty("id")){
				for each (var albumResult:Object in object as ArrayCollection) {
					this._elementArray.push(new Album(albumResult));				
				}
			} else {
					this._elementArray.push(new Album(object));
			}
		}
		
		public function get time():Number
		{
			return 0;
		}
		
		public function getAlbumByIndex(index:Number):IAlbum
		{
			return super.getElementByIndex(index) as IAlbum;
		}
		
		public function getAlbumByName(name:String):IAlbum
		{
			return null;
		}
		
		
		public function get currentAlbum():IAlbum
		{
			return super.currentElement as IAlbum;
		}
		
		
		public function get nextAlbum():IAlbum
		{
			return super.nextElement as IAlbum;
		}

		
		public function get prevAlbum():IAlbum
		{
			return super.prevElement as IAlbum;
		}
		
		public function get lastSong():Object
		{
			return null;
		}
		
		public function get lastAlbum():IAlbum
		{
			return null;
		}
		
		public function get coverList():ICoverList
		{
			return null;
		}

		
	}
}